package com.sky.controller.user;

import com.sky.dto.CategoryDTO;
import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: UserCategroyController
 * Package: com.sky.controller.user
 * Description:
 *
 * @Autehor 屈子岩
 * @Create 2024/9/14 11:05
 * @Version 1.0
 */
@RequestMapping("user/category")
@RestController
@Slf4j
public class UserCategroyController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("list")
    public Result<List<Category>> list(/*CategoryDTO categoryDTO*/){
        log.info("根据类型查询分类数据:{}"/*,categoryDTO*/);
        List<Category> categories = categoryService.list();/*selectByType(categoryDTO.getType())*/;
        return Result.success(categories);
    }
}
